package com.aruba.hiltapplication.di.module

import com.aruba.hiltapplication.di.bean.UserInfo2
import com.aruba.hiltapplication.di.qualifier.Zhao
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent
import dagger.hilt.android.scopes.ViewModelScoped
import javax.inject.Named

/**
 * Created by aruba on 2021/12/6.
 */
@InstallIn(ViewModelComponent::class)
@Module
class UserInfo2Fetcher {

    @Zhao
    @ViewModelScoped
    @Provides
    fun provideUserInfo(): UserInfo2 {
        return UserInfo2("赵四")
    }

    @Named("wang")
    @ViewModelScoped
    @Provides
    fun provideUserInfo2(): UserInfo2 {
        return UserInfo2("王五")
    }
}